package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_luckybag_consume", schema = "", catalog = "onedollar")
public class TLuckybagConsumeEntity {
    private int id;
    private int luckybagId;
    private Integer consumer;
    private Double money;
    private Integer orderby;
    private Integer win;
    private Timestamp consumetime;
    private int status;

    @Id
    @GeneratedValue
    @Column(name = "id", nullable = false, insertable = false, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "luckybag_id", nullable = false, insertable = true, updatable = true)
    public int getLuckybagId() {
        return luckybagId;
    }

    public void setLuckybagId(int luckybagId) {
        this.luckybagId = luckybagId;
    }

    @Basic
    @Column(name = "consumer", nullable = true, insertable = true, updatable = true)
    public Integer getConsumer() {
        return consumer;
    }

    public void setConsumer(Integer consumer) {
        this.consumer = consumer;
    }

    @Basic
    @Column(name = "money", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    @Basic
    @Column(name = "orderby", nullable = true, insertable = true, updatable = true)
    public Integer getOrderby() {
        return orderby;
    }

    public void setOrderby(Integer orderby) {
        this.orderby = orderby;
    }

    @Basic
    @Column(name = "win", nullable = true, insertable = true, updatable = true)
    public Integer getWin() {
        return win;
    }

    public void setWin(Integer win) {
        this.win = win;
    }

    @Basic
    @Column(name = "consumetime", nullable = true, insertable = true, updatable = true)
    public Timestamp getConsumetime() {
        return consumetime;
    }

    public void setConsumetime(Timestamp consumetime) {
        this.consumetime = consumetime;
    }

    @Basic
    @Column(name = "status", nullable = false, insertable = true, updatable = true)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TLuckybagConsumeEntity that = (TLuckybagConsumeEntity) o;

        if (id != that.id) return false;
        if (luckybagId != that.luckybagId) return false;
        if (status != that.status) return false;
        if (consumer != null ? !consumer.equals(that.consumer) : that.consumer != null) return false;
        if (money != null ? !money.equals(that.money) : that.money != null) return false;
        if (orderby != null ? !orderby.equals(that.orderby) : that.orderby != null) return false;
        if (win != null ? !win.equals(that.win) : that.win != null) return false;
        if (consumetime != null ? !consumetime.equals(that.consumetime) : that.consumetime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + luckybagId;
        result = 31 * result + (consumer != null ? consumer.hashCode() : 0);
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (orderby != null ? orderby.hashCode() : 0);
        result = 31 * result + (win != null ? win.hashCode() : 0);
        result = 31 * result + (consumetime != null ? consumetime.hashCode() : 0);
        result = 31 * result + status;
        return result;
    }
}
